﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using Kent.Boogaart.HelperTrinity;

namespace OptionsDemo
{
	[Serializable]
	public sealed class OptionsData : INotifyPropertyChanged
	{
		private string _name;
		private int _age;

		public string Name
		{
			get
			{
				return _name;
			}
			set
			{
				if (_name != value)
				{
					_name = value;
					OnPropertyChanged("Name");
				}
			}
		}

		public int Age
		{
			get
			{
				return _age;
			}
			set
			{
				if (_age != value)
				{
					_age = value;
					OnPropertyChanged("Age");
				}
			}
		}

		public event PropertyChangedEventHandler PropertyChanged;

		private void OnPropertyChanged(string propertyName)
		{
			EventHelper.Raise(PropertyChanged, this, new PropertyChangedEventArgs(propertyName));
		}
	}
}
